

#ifndef __CCE_SESSION_H__
#define __CCE_SESSION_H__

#include <QObject>
#include <mainwindow.h>
#include <material/materialmanager.h>
#include <material/materialview.h>
#include <material/materialoverviewdialog.h>
#include <object/objectoverviewdialog.h>

#include <engine.h>


#define CCE_FILESYSTEM_MIME "text/uri-list"

class cceSession : public QObject
{
	Q_OBJECT
private:
  cceMainWindow*	_mainWindow;

	cceMaterialManager*	_materialManager;

	cceMaterialOverviewDialog*	_materialOverview;
  cceObjectOverviewDialog*    _objectOverview;
	QString                     _projectFolder;

  ceEngine                    *_engine;
private:
	cceSession ();

  void ConnectSignals ();

public:
	static cceSession* Get ();

	cceMaterialManager* GetMaterialManager () { return _materialManager; }

	void Initialize ();

	/**
	 * @brief Copies a file from the filesystem into \a subfolder within the \a project folder.
	 *
	 * If \a replace \a = \a true and the permissions are not given to remove the existing file this
	 * call will fail returns \a QString::Null ()
	 *
	 * @param filename The (absolute) filename within the filesystem
	 * @param subfolder The subfolder beyond the projet directory
	 * @param replace Whether or not the file should be replaced if it already exists.
	 *
	 * @return The new filename within the project folder. If the call failed a \a QString::Null() String will be returned.
	 */
	QString CopyFileToProjectPath (const QString& filename, const QString& subfolder, bool replace = true);

	QString GetFileName (const QString& localFilename) const;

  /**
   * @brief Returns the engine that is used during the session
   *
   * @return The current engine;
   */
  ceEngine* GetEngine ();


public slots:
  void QuitApplication ();
  void ShowObjectBrowser ();
  void ShowMaterialBrowser ();
};


#endif /* __CCE_SESSION_H__ */

